package wnhz.com.business.freeshop.fragment;

import android.os.Build;
import android.os.Bundle;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import wnhz.com.business.BeginActivity;
import wnhz.com.business.R;
import wnhz.com.business.base.BaseActivity;
import wnhz.com.business.base.MyBaseActivity;
import wnhz.com.business.base.MyBaseFragment;
import wnhz.com.business.freeshop.FreeShopActivity;
import wnhz.com.business.freeshop.activity.fourthfree.AllOrderActivity;
import wnhz.com.business.freeshop.activity.fourthfree.ApplyActivity;
import wnhz.com.business.freeshop.activity.fourthfree.FundActivity;
import wnhz.com.business.freeshop.activity.fourthfree.HelpCenterActivity;
import wnhz.com.business.freeshop.activity.fourthfree.MeassageChangeActivity;
import wnhz.com.business.freeshop.activity.fourthfree.MessageActivity;
import wnhz.com.business.freeshop.activity.fourthfree.MyAttentionActivity;
import wnhz.com.business.freeshop.activity.fourthfree.MyCollectActivity;
import wnhz.com.business.freeshop.activity.fourthfree.SettingActivity;

/**
 * Created by Administrator on 2017/9/21 0021.
 */

public class FourthFragment extends MyBaseFragment {
    @BindView(R.id.iv_r_head)
    ImageView ivRHead;
    @BindView(R.id.tv_r_userName)
    TextView tvRUserName;
    @BindView(R.id.tv_r_phone)
    TextView tvRPhone;
    @BindView(R.id.ll_r_message)
    LinearLayout llRMessage;
    @BindView(R.id.ll_r_allOrder)
    LinearLayout llRAllOrder;
    @BindView(R.id.ll_r_one)
    LinearLayout llROne;
    @BindView(R.id.ll_r_two)
    LinearLayout llRTwo;
    @BindView(R.id.ll_r_three)
    LinearLayout llRThree;
    @BindView(R.id.ll_r_four)
    LinearLayout llRFour;
    @BindView(R.id.ll_r_fifth)
    LinearLayout llRFifth;
    @BindView(R.id.ll_r_collect)
    LinearLayout llRCollect;
    @BindView(R.id.ll_r_attention)
    LinearLayout llRAttention;
    @BindView(R.id.ll_r_fund)
    LinearLayout llRFund;
    @BindView(R.id.ll_r_help)
    LinearLayout llRHelp;
    @BindView(R.id.ll_r_main)
    LinearLayout llRMain;
    @BindView(R.id.ll_r_shenqin)
    LinearLayout llRShenqin;
    @BindView(R.id.ll_r_setting)
    LinearLayout llRSetting;
    Unbinder unbinder;

    private MyBaseActivity activity;

    @Override
    protected void handleMsg(Message msg) {

    }

    @Override
    protected View initView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_free_fourth, container, false);
        ButterKnife.bind(this, view);
        activity = (MyBaseActivity) getActivity();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
        }
        return view;
    }


    @OnClick({R.id.tv_r_userName, R.id.tv_r_phone, R.id.ll_r_message, R.id.ll_r_allOrder, R.id.ll_r_one, R.id.ll_r_two, R.id.ll_r_three, R.id.ll_r_four, R.id.ll_r_fifth, R.id.ll_r_collect, R.id.ll_r_attention, R.id.ll_r_fund, R.id.ll_r_help, R.id.ll_r_main, R.id.ll_r_shenqin, R.id.ll_r_setting})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_r_userName://用户名字
                startActivity(MeassageChangeActivity.createIntent(activity));
                break;
            case R.id.tv_r_phone://用户电话
                startActivity(MeassageChangeActivity.createIntent(activity));
                break;
            case R.id.ll_r_message://消息通知
                startActivity(MessageActivity.createIntent(activity));
                break;
            case R.id.ll_r_allOrder://所有订单
                startActivity(AllOrderActivity.createIntent(activity, "0"));
                break;
            case R.id.ll_r_one://待付款
                startActivity(AllOrderActivity.createIntent(activity, "1"));
                break;
            case R.id.ll_r_two://待发货
                startActivity(AllOrderActivity.createIntent(activity, "2"));
                break;
            case R.id.ll_r_three://待收货
                startActivity(AllOrderActivity.createIntent(activity, "3"));
                break;
            case R.id.ll_r_four://待评价
                startActivity(AllOrderActivity.createIntent(activity, "4"));
                break;
            case R.id.ll_r_fifth://退款/售后
                startActivity(AllOrderActivity.createIntent(activity, "5"));
                break;
            case R.id.ll_r_collect://我的收藏
                startActivity(MyCollectActivity.createIntent(activity));
                break;
            case R.id.ll_r_attention://我的关注
                startActivity(MyAttentionActivity.createIntent(activity));
                break;
            case R.id.ll_r_fund://我的钱包
                startActivity(FundActivity.createIntent(activity));
                break;
            case R.id.ll_r_help://帮助中心
                startActivity(HelpCenterActivity.createIntent(activity));
                break;
            case R.id.ll_r_main://返回主界面
                startActivity(BeginActivity.createIntent(activity));
                activity.finish();
                break;
            case R.id.ll_r_shenqin://申请成为服务商家
                startActivity(ApplyActivity.createIntent(activity));
                break;
            case R.id.ll_r_setting://设置
                startActivity(SettingActivity.createIntent(activity));
                break;
        }
    }
}
